package com.orgcent.tuangou.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

/***
 * 配置信息
 */
public class Prefs {

	private SharedPreferences _prefs = null;
	private Editor _editor = null;

	public Prefs(Context context) {
		this._prefs = context.getSharedPreferences("com.orgcent.tuangou_preferences", Context.MODE_PRIVATE);
		this._editor = this._prefs.edit();
	}

	public String getValue(String key, String defaultvalue) {
		return _prefs.getString(key, defaultvalue);
	}
	
	public boolean getBoolean(String key, boolean defaultvalue) {
		return _prefs.getBoolean(key, defaultvalue);
	}

	public void setValue(String key, String value) {
		this._editor.putString(key, value);
	}

	public void save() {
		this._editor.commit();
	}
}
